const express = require('express');
const router = express.Router();
const data = [];
for(let i = 1; i < 51; i++)
    data.push({
        id: `${i}`,
        code: 'string',
        dealerCode: 'string',
        dealerName: 'string',
        typeName: 'string',
        status: 1,
        orderReason: 'string',
        totalFee: 10000,
        warehouseName: 'string',
        creditCode: 'string',
        creditDescribe: 'string',
        orderReasonCode: 'string',
        requiredArrivedDate: '2018-12-04T02:37:44.918Z',
        remark: 'string',
        creatorName: 'string',
        createTime: '2018-12-04T02:37:44.918Z',
        modifierName: 'string',
        modifyTime: '2018-12-04T02:37:44.918Z',
        submitterName: 'string',
        submitTime: '2018-12-04T02:37:44.918Z',
        confirmorName: 'string',
        confirmTime: '2018-12-04T02:37:44.918Z',
        abandonerName: 'string',
        abandonTime: '2018-12-04T02:37:44.918Z',
        rowVersion: 'string',
        options: [
            'update',
            'abandon',
            'submit',
            'confirm',
            'assistAdd',
            'assistUpdate',
            'assistSubmit',
            'assistAbandon',
            'return'
        ]
    });
router.get('/forCurrentUser', (req, res) => {
    const {pageIndex, pageSize} = req.query;
    res.json({
        message: 'ok',
        payload: {
            content: data,
            pageIndex: parseInt(pageIndex, 10),
            pageSize: parseInt(pageSize, 10),
            totalElements: 50
        }
    });
});

router.get('/export/forCurrentUser', (req, res) => {
    res.json({
        message: '导出成功',
        payload: 'Mock导出'
    });
});

router.post('/import', (req, res) => {
    res.json({
        message: '导入成功'
    });
});
module.exports = router;
